<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head th:fragment="html-head(pageTitle,pageKey,pageDesc)">
    <link rel="icon" type="image/x-icon" th:href="@{/images/favicon.ico}">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="baidu-site-verification" content="DGxSSgI8VK" />
    <title th:text="${pageTitle}">Spring Boot中文社区</title>
    <meta name="description" th:content="${pageDesc}" />
    <meta name="keywords" th:content="${pageKey}" />
    <meta name="author" content="spring-boot.tech" />
    <meta name="csrf-token" th:content="${_csrfToken}">
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" th:href="@{/bootstrap/css/bootstrap.min.css}">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css">
    <!-- Ionicons -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css">
    <!-- Theme style -->
    <link rel="stylesheet" th:href="@{/dist/css/AdminLTE.css}">
    <!-- AdminLTE Skins. Choose a skin from the css/skins
         folder instead of downloading all of them to reduce the load. -->
    <link rel="stylesheet" th:href="@{/dist/css/skins/_all-skins.css}">
    <link rel="stylesheet" th:href="@{/dist/css/style.css}">
    <link rel="stylesheet" th:href="@{/editor/css/editormd.css}">
    <link rel="stylesheet" th:href="@{/editor/css/editormd.preview.css}" />
    <link rel="stylesheet" th:href="@{/plugins/jqueryPagination/css/pagination.css}">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<!--前台布局-->
<header class="main-header" th:fragment="main-header">
    <nav class="navbar navbar-static-top">
        <div class="container">
            <div class="navbar-header">
                <a th:href="@{/}" class="navbar-brand"><img th:src="@{/images/boot-log.png}" style="width: auto;height: 55px;margin-top: -18px;margin-left: 12px;margin-right: 4px;" ></a>
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse">
                    <i class="fa fa-bars"></i>
                </button>
            </div>

            <!-- Collect the nav links, forms, and other content for toggling -->
            <div class="collapse navbar-collapse pull-left" id="navbar-collapse">
                <ul class="nav navbar-nav">
                    <li th:class="${_view.active(#httpServletRequest.requestURI,'/topics')}"><a th:href="@{/topics}">社区 <span class="sr-only">(current)</span></a></li>
                    <li><a href="#">招聘</a></li>
                    <li><a href="#">头条</a></li>
                    <li><a href="#">问答</a></li>
                </ul>
                <form class="navbar-form navbar-left" role="search">
                    <div class="form-group">
                        <input type="text" class="form-control" id="navbar-search-input" placeholder="搜索">
                    </div>
                </form>
            </div>
            <!-- /.navbar-collapse -->
            <!-- Navbar Right Menu -->
            <div class="navbar-custom-menu dropdown">
                <!--登录后显示用户中心-->
                <ul class="nav navbar-nav" th:if="${@UserService.hasLogin(#httpServletRequest)}">
                    <!-- Notifications Menu -->
                    <li class="dropdown notifications-menu">
                        <!-- Menu toggle button -->
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                            <i class="fa fa-bell-o"></i>
                            <span class="label label-warning">10</span>
                        </a>
                        <ul class="dropdown-menu">
                            <li class="header">You have 10 notifications</li>
                            <li>
                                <!-- Inner Menu: contains the notifications -->
                                <ul class="menu">
                                    <li><!-- start notification -->
                                        <a href="#">
                                            <i class="fa fa-users text-aqua"></i> 5 new members joined today
                                        </a>
                                    </li>
                                    <!-- end notification -->
                                </ul>
                            </li>
                            <li class="footer"><a href="#">View all</a></li>
                        </ul>
                    </li>
                    <!-- User Account Menu -->
                    <li class="dropdown user user-menu">
                        <!-- Menu Toggle Button -->
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                            <!-- The user image in the navbar-->
                            <img  class="user-image" th:src="${@UserService.getCurrentUser(#httpServletRequest).getAvatar()}" alt="User Image">
                            <!-- hidden-xs hides the username on small devices so only the image appears. -->
                            <span class="hidden-xs" ></span>
                        </a>
                        <ul class="dropdown-menu">
                            <!-- The user image in the menu -->
                            <li class="user-header">
                                <img th:src="${@UserService.getCurrentUser(#httpServletRequest).getAvatar()}" class="img-circle" alt="User Image">

                                <p>
                                    <span th:text="${@UserService.getCurrentUser(#httpServletRequest).getNickname()}"></span>
                                    <small th:text="${@UserService.getCurrentUser(#httpServletRequest).getIntroduction()}"></small>
                                </p>
                            </li>
                            <!-- Menu Footer-->
                            <li class="user-footer">
                                    <a th:href="@{/user/profile}" class="btn btn-default btn-flat"><i class="fa fa-user text-md"></i>个人中心</a>
                                    <a th:href="@{/user}" class="btn btn-default btn-flat"><i class="fa fa-cog text-md"></i>编辑资料</a>
                                    <th:block th:if="${@UserService.isAdmin(@UserService.getCurrentUser(#httpServletRequest))}">
                                        <a th:href="@{/admin}" th:class="|btn btn-default btn-flat |"><i class="fa fa-fw fa-tachometer"></i>后台管理</a>
                                    </th:block>
                                    <form th:action="@{/auth/logout}" method="post" class="logout">
                                        <input name="csrfToken" th:type="hidden" th:value="${_csrfToken}" />
                                        <a class="btn btn-default btn-flat" style="display: block"><i class="fa fa-fw fa-sign-out"></i>退出系统</a>
                                    </form>
                            </li>
                        </ul>
                    </li>
                </ul>
                <ul class="navbar-right" style="margin-top: 7px;" th:if="${@UserService.hasLogin(#httpServletRequest) == false}">
                    <a th:href="@{/auth/login}" class="btn btn-default login-btn no-pjax">
                        <i class="fa fa-user"></i>
                        登 录
                    </a>
                    <a th:href="@{/auth/register}" class="btn btn-default login-btn no-pjax">
                        <i class="fa fa-user-plus"></i>
                        注 册
                    </a>
                </ul>

            </div>
            <!-- /.navbar-custom-menu -->
        </div>
        <!-- /.container-fluid -->
    </nav>
</header>
<footer class="main-footer" th:fragment="main-footer">
    <div class="container">
        <div class="pull-right hidden-xs">
            <b>Version</b> 2.3.12
        </div>
        <strong>Copyright &copy; 2014-2016 <a href="http://almsaeedstudio.com">Almsaeed Studio</a>.</strong> All rights
        reserved.
    </div>
    <!-- /.container -->
    <!-- ./wrapper -->
</footer>
<th:block th:fragment="modal">
    <!-- 模态框（Modal）提示框 -->
    <div class="modal fade" id="dialogTip" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                    <h4 class="modal-title" id="myModalLabel">{{dialogTitle}}</h4>
                </div>
                <div class="modal-body"><div class="alert" v-bind:class="{'alert-success':isSuccess, 'alert-danger':hasError}">{{dialogContent}}</div></div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div>
    <!--对话确认框-->
    <div class="modal fade" id="dialogConfirm" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                    <h4 class="modal-title" id="myModalConfirmLabel">确认框</h4>
                </div>
                <div class="modal-body"><div class="alert alert-warning">{{dialogContent}}</div></div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">返回</button>
                    <button type="button" class="btn btn-primary confirm">确认</button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div>

</th:block>
<th:block th:fragment="main-script">
    <!-- jQuery 2.2.3 -->
    <script th:src="@{/plugins/jQuery/jquery-2.2.3.min.js}"></script>

    <!-- Bootstrap 3.3.6 -->
    <script th:src="@{/bootstrap/js/bootstrap.min.js}"></script>

    <!-- SlimScroll -->
    <script th:src="@{/plugins/slimScroll/jquery.slimscroll.min.js}"></script>
    <script th:src="@{/plugins/jQuery/jquery.form.min.js}" />
    <!-- FastClick -->
    <script th:src="@{/plugins/fastclick/fastclick.js}"></script>

    <!--markdown-->
    <script th:src="@{/editor/lib/marked.min.js}"></script>
    <script th:src="@{/editor/lib/prettify.min.js}"></script>
    <script th:src="@{/editor/lib/raphael.min.js}"></script>
    <script th:src="@{/editor/lib/underscore.min.js}"></script>
    <script th:src="@{/editor/lib/sequence-diagram.min.js}"></script>
    <script th:src="@{/editor/lib/flowchart.min.js}"></script>
    <script th:src="@{/editor/lib/jquery.flowchart.min.js}"></script>
    <script th:src="@{/editor/src/editormd.js}"></script>
    <!-- AdminLTE App -->
    <script th:src="@{/dist/js/app.min.js}"></script>
    <!-- AdminLTE for demo purposes -->
    <!--<script th:src="@{/dist/js/demo.js}"></script>-->
    <script th:src="@{/plugins/jqueryPagination/js/pagination.min.js}"></script>
    <script th:if="${env == 'dev'}" th:src="@{/plugins/vue/vue.js}"></script>
    <script th:if="${env == 'product'}" th:src="@{/plugins/vue/vue.min.js}"></script>
    <!--<script src="https://unpkg.com/axios/dist/axios.min.js"></script>-->
    <script th:src="@{/dist/js/util.js}"></script>

    <script>
        $.ajaxSetup({
            headers: {
                'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
            }
        });
        $(function () {
            $("[data-toggle='tooltip']").tooltip();
            $('form.logout a').on('click',function() {
                $('form.logout').submit();
            });
        });
    </script>
</th:block>

<th:block th:fragment="user-left-bar">
    <div th:class="'col-md-3 pull-left' ">
        <div class="panel panel-default">
            <div class="panel-body text-center">
                <ul class="list-group">
                    <a th:href="@{/user}" th:class="|list-group-item | + ${_view.active(#httpServletRequest.requestURI,'/user')}"><i class="fa fa-list-alt" style="margin-right: 10px"></i>个人信息</a>
                    <a th:href="@{/user/editAvatar}" th:class="|list-group-item | + ${_view.active(#httpServletRequest.requestURI,'/user/editAvatar')}"><i class="fa fa-picture-o" style="margin-right: 10px"></i>修改头像</a>
                    <a th:href="@{/user/editEmailNotify}" th:class="|list-group-item | + ${_view.active(#httpServletRequest.requestURI,'/user/editEmailNotify')}"><i class="fa fa-bell" style="margin-right: 10px"></i>消息通知</a>
                    <a th:href="@{/user/editPassword}" th:class="|list-group-item | + ${_view.active(#httpServletRequest.requestURI,'/user/editPassword')}"><i class="fa fa-lock" style="margin-right: 10px"></i>修改密码</a>
                </ul>
            </div>
        </div>
    </div>
</th:block>

<!--后台布局-->
<header class="main-header" th:fragment="admin-main-header">
    <!-- Logo -->
    <a th:href="@{/admin}" class="logo">
        <!-- mini logo for sidebar mini 50x50 pixels -->
        <span class="logo-mini"><b>A</b>LT</span>
        <!-- logo for regular state and mobile devices -->
        <span class="logo-lg"><b>Admin</b>LTE</span>
    </a>
    <!-- Header Navbar: style can be found in header.less -->
    <nav class="navbar navbar-static-top">
        <!-- Sidebar toggle button-->
        <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </a>

        <div class="navbar-custom-menu">
            <!--登录后显示用户中心-->
            <ul class="nav navbar-nav" th:if="${@UserService.hasLogin(#httpServletRequest)}">
                <!-- Notifications Menu -->
                <li class="dropdown notifications-menu">
                    <!-- Menu toggle button -->
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                        <i class="fa fa-bell-o"></i>
                        <span class="label label-warning">10</span>
                    </a>
                    <ul class="dropdown-menu">
                        <li class="header">You have 10 notifications</li>
                        <li>
                            <!-- Inner Menu: contains the notifications -->
                            <ul class="menu">
                                <li><!-- start notification -->
                                    <a href="#">
                                        <i class="fa fa-users text-aqua"></i> 5 new members joined today
                                    </a>
                                </li>
                                <!-- end notification -->
                            </ul>
                        </li>
                        <li class="footer"><a href="#">View all</a></li>
                    </ul>
                </li>
                <!-- User Account Menu -->
                <li class="dropdown user user-menu">
                    <!-- Menu Toggle Button -->
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                        <!-- The user image in the navbar-->
                        <img  class="user-image" th:src="${@UserService.getCurrentUser(#httpServletRequest).getAvatar()}" alt="User Image">
                        <!-- hidden-xs hides the username on small devices so only the image appears. -->
                        <span class="hidden-xs" ></span>
                    </a>
                    <ul class="dropdown-menu">
                        <!-- The user image in the menu -->
                        <li class="user-header">
                            <img th:src="${@UserService.getCurrentUser(#httpServletRequest).getAvatar()}" class="img-circle" alt="User Image">
                            <p>
                                <span th:text="${@UserService.getCurrentUser(#httpServletRequest).getNickname()}"></span>
                                <small th:text="${@UserService.getCurrentUser(#httpServletRequest).getIntroduction()}"></small>
                            </p>
                        </li>
                        <!-- Menu Footer-->
                        <li class="user-footer">
                            <a th:href="@{/user/profile}" class="btn btn-default btn-flat"><i class="fa fa-user text-md"></i>个人中心</a>
                            <a th:href="@{/user}" class="btn btn-default btn-flat"><i class="fa fa-cog text-md"></i>编辑资料</a>
                            <th:block th:if="${@UserService.isAdmin(@UserService.getCurrentUser(#httpServletRequest))}">
                                <a th:href="@{/}" th:class="|btn btn-default btn-flat |"><i class="fa fa-fw fa-tachometer"></i>返回前台</a>
                            </th:block>
                            <form th:action="@{/auth/logout}" method="post" class="logout">
                                <input name="csrfToken" th:type="hidden" th:value="${_csrfToken}" />
                                <a class="btn btn-default btn-flat" style="display: block"><i class="fa fa-fw fa-sign-out"></i>退出系统</a>
                            </form>
                        </li>
                    </ul>
                </li>
            </ul>
            <!--<ul class="navbar-right" style="margin-top: 7px;" th:if="${@UserService.hasLogin(#httpServletRequest) == false}">-->
                <!--<a th:href="@{/auth/login}" class="btn btn-default login-btn no-pjax">-->
                    <!--<i class="fa fa-user"></i>-->
                    <!--登 录-->
                <!--</a>-->
                <!--<a th:href="@{/auth/register}" class="btn btn-default login-btn no-pjax">-->
                    <!--<i class="fa fa-user-plus"></i>-->
                    <!--注 册-->
                <!--</a>-->
            <!--</ul>-->
        </div>
    </nav>
</header>
<!-- Left side column. contains the sidebar -->
<aside class="main-sidebar" th:fragment="admin-main-sidebar">
    <!-- sidebar: style can be found in sidebar.less -->
    <section class="sidebar">
        <ul class="sidebar-menu">
            <li th:class="|treeview | + ${_view.active(#httpServletRequest.requestURI,'/admin/category/*')}">
                <a href="#">
                    <i class="fa fa-dashboard"></i> <span>内容管理</span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <li th:class="${_view.active(#httpServletRequest.requestURI,'/admin/category/*')}"><a th:href="@{/admin/category}"><i class="fa fa-circle-o"></i> 栏目管理</a></li>
                    <li><a href="#"><i class="fa fa-circle-o"></i> Dashboard v2</a></li>
                </ul>
            </li>
        </ul>
    </section>
    <!-- /.sidebar -->
</aside>
</html>
